#include <stdio.h>

int main()
{
  int nums[] = {2, 7, 11, 15}, target;
  int all_length = sizeof nums;
  int length = sizeof nums[0];
  int size = all_length / length;
  for (int i = 0; i <= size - 1; i++)
  {
    for (int j = i + 1; j <= size - 1; j++)
    {
      if (nums[i] + nums[j] == target)
      {
        printf("[%d,%d]", i, j);
      }
    }
  }
  return 0;
}